package com.summer.obj;

import java.util.ArrayList;

public class LamudaTest {
	
	public interface ITest {
		
		void doAction();
		
	}
	
	public static ArrayList<ITest> list = new ArrayList<>();
	

	public static void main(String[] args) {
		LamudaTest test = new LamudaTest();
		
		ITest t1 = LamudaTest::testDo1;
		ITest t2 = test::testDo;
		
		LamudaTest.list.add(t1);
		LamudaTest.list.add(t2);
		LamudaTest.list.add(test.tt);
		LamudaTest.list.add(LamudaTest::testDo1);
		LamudaTest.list.add(test::testDo);
		
		System.out.println(LamudaTest.list.size());
		
		for(ITest it : LamudaTest.list) {
			it.doAction();
		}
		LamudaTest.list.remove(t1);
		LamudaTest.list.remove(t2);
		LamudaTest.list.remove(test.tt);
		LamudaTest.list.remove((ITest)LamudaTest::testDo1);
		LamudaTest.list.remove((ITest)test::testDo);
		
		System.out.println(LamudaTest.list.size());
		
		
	}
	
	public void testDo() {
		System.out.println("testDo");
	}
	
	public static void testDo1() {
		System.out.println("testDo1");
	}
	
	public ITest tt = () -> {
		System.out.println("tt");
	};
	
}
